home *** CD-ROM | disk | FTP | other *** search
- /*
- File: Level1Glyphs.c
-
- Contains: QuickDraw GX to PostScript conversion code.
- Routines for processing glyph runs using level-1 kshow.
- called from TextStylePrimitives.c
-
- Version: Technology: Quickdraw GX 1.1.x
-
- Copyright: © 1991-1997 by Apple Computer, Inc., all rights reserved.
- */
-
- #include "PublicPostScriptIE.h"
- #include "Private.h"
- #include "PSIEResources.h"
- #include <GXGraphics.h>
-
- #ifdef resumeLabel
- #undef resumeLabel
- #endif
- #define resumeLabel(exception)
-
- /*******************************************
- ProcessGlyphGroupPosL1:
-
- Routine translates a glyph group with advance
- bits specifying absolute positions for the glyphs
- to PostScript.
-
- nGlyphs: How many glyphs in the group.
- positions: Array of positions for the glyphs.
- text8: Pointer to the 8 bit data for the group.
- byteCount: Number of bytes in the 8-bit data.
- rdParams: pointer to the RDUtil parameter block.
-
- *********************************************/
- OSErr ProcessGlyphGroupPosL1(short nGlyphs, gxPoint *positions, char *text8, long byteCount,
- TRDParams *rdParams, TGlyphPosBias theBias, long addToIndex)
- {
- OSErr status;
- gxPoint* pPoint;
- register short j;
-
- /* Put the pen at the position of the first glyph in the group */
-
- status = DoMoveto( rdParams, &(positions[0]));
- nrequire(status, failed_Output);
-
- /** Output all of the positions in reverse order **/
-
- pPoint = positions + nGlyphs - 1;
-
- if (theBias == eAllHorizontal) {
-
- rdParams->resIndex = kDoFixed;
- for (j = nGlyphs-2; j >= 0; --j) { // Do all but the first point.
-
- status = RDResPrintf(rdParams, pPoint->x);
- nrequire(status, failed_Output);
- --pPoint;
-
- }//end for
-
- status = RDResPrintf(rdParams, positions[0].y); // Output the constant Y value on the stack.
- nrequire(status, failed_Output);
-
- rdParams->resIndex = addToIndex + kKshowH;
-
- } else if (theBias == eAllVertical) {
-
- rdParams->resIndex = kDoFixed;
- for (j = nGlyphs-2; j >= 0; --j) { // Do all but the first point.
-
- status = RDResPrintf(rdParams, pPoint->y);
- nrequire(status, failed_Output);
- --pPoint;
-
- }//end for
-
- status = RDResPrintf(rdParams, positions[0].x); // Output the constant Y value on the stack.
- nrequire(status, failed_Output);
-
- rdParams->resIndex = addToIndex + kKshowV;
-
- } else {
-
- rdParams->resIndex = kDoPoint;
- for (j = nGlyphs-2; j >= 0; --j) { // Do all but the first point.
-
- status = RDResPrintf(rdParams, pPoint);
- nrequire(status, failed_Output);
- --pPoint;
-
- }//end for
-
- if (byteCount == 1) // either will work, but for 1 byte show is more efficient.
- rdParams->resIndex = addToIndex + kShow;
- else
- rdParams->resIndex = addToIndex + kKshow;
-
- } //end if
-
- status = RDResPrintf(rdParams, text8, byteCount);
- nrequire(status, failed_Output);
-
- failed_Output:
- return(status);
-
- }//ProcessGlyphGroupPosL1
-
-
-
-